<?php

class BaseService {

    public static function validateInputParam(array $data, array $rules, array $messages = array(), $attributes = array()){
        $validator = Validator::make($data, $rules, $messages, $attributes);
        if($validator->fails()){
            throw new ParameterInvalidException($validator->messages()->first());
        }
    }

    public static function getResult($message = null){
        return Response::json( array('code' => 0, 'message' => $message) );
    }
}